import request from '@/utils/request';

/** 获取文章评论Type */
export type CommentsQueryType = {
  type: 'a' | 'c';
  source: string;
  offset?: string;
  limit?: number;
};
/** 获取文章评论API */
export function getCommentsByIdAPI(params: CommentsQueryType) {
  return request({
    url: '/v1_0/comments',
    params,
  });
}

export type SendCommentParamsType = {
  target: string;
  content: string;
  art_id?: string;
};
/** 发表文章评论API */
export function sendCommentAPI(data: SendCommentParamsType) {
  return request({
    url: '/v1_0/comments',
    method: 'post',
    data,
  });
}
